Krzesimir Nowak [Mon, 9 May 2016 13:11:18 +0000 (15:11 +0200)]
sysroot: Plug some leaks
The deployments and booted deployment were never unreffed.
Also, remote (void) from the call to the unload function - it returns
nothing, so there is no need to fool the compiler.
Closes: #287
Approved by: cgwalters
Colin Walters [Sat, 7 May 2016 15:22:47 +0000 (11:22 -0400)]
trivial-httpd: Add __attribute__((format))
I was briefly looking at building with clang mostly since it
detects unused variables with cleanup attributes, but then
I hit this fatal error.
It's a hard compile error with `-Wformat-nonliteral` since clang
doesn't know it's a format string.
Colin Walters [Fri, 6 May 2016 16:25:27 +0000 (12:25 -0400)]
build: Use --std=gnu99
It's actually very nice to be able to declare loop variables inside
the initializer.
Ideally we could turn off nested functions though.
Closes: #284
Approved by: jlebon
Jonathan Lebon [Fri, 22 Apr 2016 16:42:05 +0000 (12:42 -0400)]
tests/test-libarchive-import.c: add tests
- Do a bit of refactoring
- Add test for use_ostree_convention
- Add test for xattr_callback
- Add test for SELinux labeling
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:39:54 +0000 (12:39 -0400)]
tests/test-libarchive.sh: add more test
- Test both tar and cpio archives
- Test more hardlink corner cases
- Test symlinks more rigorously
- Test stat override
- Test skip list
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:35:48 +0000 (12:35 -0400)]
ot-builtin-commit.c: add --skip-list option
This was already supported by the commit modifier API, just needed to
expose it. This will also be used to test the libarchive API in a future
test.
Closes: #275
Approved by: cgwalters
Jonathan Lebon [Fri, 22 Apr 2016 16:24:04 +0000 (12:24 -0400)]
ostree-repo-libarchive.c: major refactor
- Make hardlink handling more generic. The previous strategy worked for
tar archives, but not for cpio. It now works for both.
- Add support for SEL labeling (through the OstreeRepoCommitModifier)
- Add support for xattr_callback (through the OstreeRepoCommitModifier)
- Add support for filter (through the OstreeRepoCommitModifier)
- Add a use_ostree_convention option
Closes: #275
Approved by: cgwalters
Colin Walters [Tue, 3 May 2016 21:24:25 +0000 (17:24 -0400)]
libglnx porting: Migrate to glnx_stream_fstat()
I ended up deciding to move this one into libglnx, seems like
something other libglnx-using software might want to do, even though
xdg-app doesn't right now.
Closes: #282
Approved by: jlebon
Colin Walters [Thu, 5 May 2016 21:20:04 +0000 (17:20 -0400)]
lib: Add more filename validations (no ., .. or /) in commit logic
The filesystem commit code will never give us potentially hostile
filenames, and when importing from archives, we do some validation.
However, we should be extra paranoid and also add error messages in
the mtree in case someone tries to import a hostile
libarchive-supported format.
Closes: #283
Approved by: jlebon
Colin Walters [Mon, 21 Mar 2016 21:54:45 +0000 (17:54 -0400)]
repo: Make repo/tmp expiry configurable via tmp-expiry-seconds
We were arbitrarily only deleting content after exactly one day. Some
use cases may want something else; make it configurable.
Closes: #170
Approved by: jlebon
Colin Walters [Wed, 13 Jan 2016 16:33:54 +0000 (11:33 -0500)]
repo: Clean up staging directory for previous boot IDs
We had a policy of cleaning up all files in `$repo/tmp` older
than one day, but we should really clean up previous bootid staging
directories too, as they can potentially take up a lot of disk space.
https://bugzilla.gnome.org/show_bug.cgi?id=760531
Closes: #170
Approved by: jlebon
Colin Walters [Tue, 19 Apr 2016 19:19:46 +0000 (15:19 -0400)]
repo: Add OSTREE_BOOTID override envvar for debugging
It's useful for test cases to be able to influence this.
Conflicts:
src/libostree/ostree-repo.c
Closes: #170
Approved by: jlebon
Colin Walters [Tue, 19 Apr 2016 16:11:01 +0000 (12:11 -0400)]
repo: Add OSTREE_REPO_TEST_ERROR=pre-commit env var
Setting this causes commit to error out. There are other ways we
could do this in a more sophisticated fashion, such as via SystemTap
etc. But this has low-tech applicablity, works as non-root.
The reason I'm adding this is so that we can add test cases for
cleanup of the `tmp/staging-` directory.
Closes: #170
Approved by: jlebon
Colin Walters [Mon, 2 May 2016 14:20:46 +0000 (10:20 -0400)]
repo: Fix reading repos on read-only media
I have a cache drive I often mount read-only, and the previous commit
for opening `tmp/cache` broke since `errno == EROFS`, not `EPERM`.
It turns out we already had the concept of a "writable" repo, so just
piggy back off that.
Closes: #281
Approved by: giuseppe
Colin Walters [Sun, 1 May 2016 18:22:52 +0000 (14:22 -0400)]
libglnx porting: Migrate from GSConsole
To GLnxConsoleRef. There were some subtleties here, for example we
used to reference `GSConsole` inside the progress changed function,
which at first seems like an ABI hazard, because e.g. rpm-ostree or
xdg-app could still be passing a `GSConsole` instance there. Luckily,
it turns out to be compatible to just start calling libglnx here.
Another issue was that due to libglnx's use of the cleanup function,
we needed to ensure we always called `ostree_async_progress_finish()`
*before* the cleanup function was invoked.
Closes: #280
Approved by: giuseppe
Colin Walters [Thu, 28 Apr 2016 15:34:27 +0000 (11:34 -0400)]
build: Introduce --with-dracut=yesbutnoconf
It's actually just easier for build systems (e.g. rpm-ostree)
using dracut to use `--add ostree` rather than indirecting
through the conf file.
This makes it easier for yum-managed systems to install ostree without
side effects.
Closes: #279
Approved by: gatispaeglis
Colin Walters [Mon, 25 Apr 2016 19:59:36 +0000 (15:59 -0400)]
deploy: Start hardlinking kernel/initramfs on single-part again
Commit
https://github.com/ostreedev/ostree/commit/
1810de2b51680dbf35fdbd33d0a8d7e65eadc91f
lost an optimization where we would try hardlinks for the
kernel/initramfs in `/boot`. This would be a noticeable space savings
on single-partition systems.
Closes: #277
Approved by: gatispaeglis
Simon McVittie [Mon, 25 Apr 2016 11:50:32 +0000 (12:50 +0100)]
test-parent: this test requires user xattrs
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #278
Approved by: cgwalters
Gatis Paeglis [Mon, 25 Apr 2016 11:57:03 +0000 (13:57 +0200)]
Fix --enable_rofiles_fuse=no build
Closes: #276
Approved by: cgwalters
Alexander Larsson [Fri, 22 Apr 2016 08:28:53 +0000 (10:28 +0200)]
repo: Handle parent repos with different remote configuration
In the case we have a repo with a parent, and the child repo has a
remote called "foo", but some option is unset. Then when we look up
the parent repo for a value before using the default we will fail due
to the parent not having the "foo" remote. As soon as we find the
requested remote at some point in the hierarchy we need to ignore further
errors and use the default value.
Closes: #274
Approved by: giuseppe
Krzesimir Nowak [Fri, 22 Apr 2016 12:41:04 +0000 (14:41 +0200)]
tests: Add a test for ostree pull --url
Closes: #271
Approved by: cgwalters
Krzesimir Nowak [Fri, 22 Apr 2016 12:40:05 +0000 (14:40 +0200)]
trivial-httpd: Add a --log-file option
Might be useful to see what files the client wants to fetch.
Closes: #271
Approved by: cgwalters
Krzesimir Nowak [Wed, 20 Apr 2016 08:34:04 +0000 (10:34 +0200)]
pull: Add a --url option
This allows ostree to pull the objects from a different URL without
modifying the repo's config.
Closes: #271
Approved by: cgwalters
Krzesimir Nowak [Tue, 19 Apr 2016 09:32:14 +0000 (11:32 +0200)]
lib: Add URL override pull option
The "override-url" option allows to use the other URL while still
using some options from the passed remote.
Closes: #271
Approved by: cgwalters
Alexander Larsson [Fri, 22 Apr 2016 07:29:59 +0000 (09:29 +0200)]
repo: Fix temporary directory allocation
We looked for and locked old temporary directories so we can
reuse them if not in use. However, once we found one that
we can reuse we didn't stop iterating, and eventually we
reached the end. This means we can lock multiple dirs.
Closes: #273
Approved by: giuseppe
Colin Walters [Thu, 21 Apr 2016 19:14:51 +0000 (15:14 -0400)]
repo: Simplify internal has_object() lookup code
There was some leftover intermediate cruft here I noticed
while reviewing another patch:
- We had an output `GFile*` for that was never used
- We required the caller to allocate the loose pathbuf, but
none of them ever reused it
- We had an extra intermediate function
Also while looking at this, I'm now uncertain whether some of the
callers of `_ostree_repo_has_loose_object` should really be invoking
`ostree_repo_has_object()`, but let's leave that aside for now.
Closes: #272
Approved by: alexlarsson
Alexander Larsson [Wed, 20 Apr 2016 13:33:44 +0000 (15:33 +0200)]
repo: Allow loading files staged in the transaction
Currently we can load metadata from the stage dir, but not file
data, which makes no sense.
Closes: #269
Approved by: cgwalters
Gatis Paeglis [Wed, 20 Apr 2016 14:22:36 +0000 (16:22 +0200)]
Remove unused variables from install_deployment_kernel
Closes: #270
Approved by: cgwalters
Alexander Larsson [Mon, 18 Apr 2016 12:26:02 +0000 (14:26 +0200)]
ostree export: Add --prefix option
This lets you set a prefix for the resulting archive patsh.
Especially useful in combination with --subpath, for instance
--subpath=subdir --prefix=subdir to extract just subdir.
Closes: #265
Approved by: cgwalters
Alexander Larsson [Mon, 18 Apr 2016 12:17:08 +0000 (14:17 +0200)]
ostree export: Add --subpath support
This lets you export a subset of a commit.
Closes: #265
Approved by: cgwalters
Krzesimir Nowak [Tue, 19 Apr 2016 08:57:27 +0000 (10:57 +0200)]
tests, lib: Remove unused variables
Closes: #267
Approved by: cgwalters
Krzesimir Nowak [Tue, 19 Apr 2016 08:56:13 +0000 (10:56 +0200)]
lib: Fix an introspection annotation
The "allow-none" annotation does not make sense for a plain boolean
parameter.
Closes: #267
Approved by: cgwalters
Krzesimir Nowak [Tue, 19 Apr 2016 08:43:32 +0000 (10:43 +0200)]
trivial-httpd: Remove useless code
Closes: #267
Approved by: cgwalters
Krzesimir Nowak [Tue, 19 Apr 2016 08:42:51 +0000 (10:42 +0200)]
lib: Fix a typo
Closes: #267
Approved by: cgwalters
Colin Walters [Mon, 18 Apr 2016 14:25:32 +0000 (10:25 -0400)]
libtest: Skip FUSE if CAP_SYS_ADMIN not in bounding set
I'm not sure if something changed or there was a race condition , or
if extraterrestrials intervened to make the tests pass before, but
in the Docker container `/dev/fuse` does exist and since we appear
to be running as uid 0 it'll be writable.
We previously discussed that another requirement for FUSE (and most
setuid binaries) is having `CAP_SYS_ADMIN`, so let's check for that in
the bounding set too.
Closes: #266
Approved by: jlebon
Simon McVittie [Sun, 17 Apr 2016 08:57:06 +0000 (09:57 +0100)]
libtest: show files' contents when assertions about them fail
I've seen an intermittent test failure in an autobuilder (sbuild)
environment where logs from failed builds cannot be retrieved,
but I can no longer reproduce it. Put the contents of the offending
file in the test's failing output so that if the failure comes back,
it can be debugged.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #264
Approved by: cgwalters
Colin Walters [Fri, 15 Apr 2016 19:49:05 +0000 (15:49 -0400)]
Rename test-abi to test-symbols, start verifying symbols are documented
We keep forgetting to update `apidoc/ostree-sections.txt`, so let's
start enforcing it. Of course it turns out we had some bugs here
like symbols marked as public but never implemented, etc. Those
are fixed in the prior commits.
Closes: #263
Approved by: giuseppe
Colin Walters [Fri, 15 Apr 2016 19:51:51 +0000 (15:51 -0400)]
lib: Remove ostree_repo_file_make_empty_tree
This was removed in
14d682305b9c8d65e46f0aaf31e6851cf2042193 - long
before we had a stable library.
I again claim removing unimplemented symbols from the header is not an
API/ABI break.
Closes: #263
Approved by: giuseppe
Colin Walters [Fri, 15 Apr 2016 19:20:57 +0000 (15:20 -0400)]
core: Remove ostree_checksum_update_meta that was not implemented
If a symbol falls in a git merkle tree forest, but no one hears it,
did it ever exist?
I'm claiming this isn't an API/ABI break because nothing could
have actually used this. `git log -S checksum_update_meta` leads
me to
38ef75e6e04f7ec19844f9a1c178e6066682d13d which was before
we really had a stable shared library.
Closes: #263
Approved by: giuseppe
Colin Walters [Fri, 15 Apr 2016 14:51:39 +0000 (10:51 -0400)]
Release 2016.5
Closes: #261
Approved by: cgwalters
Alexander Larsson [Fri, 15 Apr 2016 08:01:42 +0000 (10:01 +0200)]
static-delta: Initialize read_source_fd to -1
If not, we'll get ESPIPE when seeking on fd 0.
Closes: #260
Approved by: cgwalters
Alexander Larsson [Thu, 14 Apr 2016 18:55:28 +0000 (20:55 +0200)]
static-delta: Put temp files in /var/tmp
We may not have write permissions in the current directory.
Closes: #259
Approved by: cgwalters
Colin Walters [Wed, 13 Apr 2016 13:28:30 +0000 (09:28 -0400)]
refs: Add g_prefix_error around opendir for easier debugging
Addresses:
https://github.com/projectatomic/rpm-ostree/issues/264
We should consider moving this down into `glnx_opendirat`, but for now
a quick fix.
Closes: #255
Approved by: jlebon
Alexander Larsson [Fri, 8 Apr 2016 15:00:59 +0000 (17:00 +0200)]
Look for $remotename.trustedkeys.gpg in remotes.d dir
This is a nice way to add gpg keys for system configured remotes
without making them globally trusted.
Closes: #247
Approved by: cgwalters
Alexander Larsson [Fri, 8 Apr 2016 14:59:12 +0000 (16:59 +0200)]
Add remotes-config-dir to OstreeRepo
This allows you to replace the default
$sysroot/$sysconfdir/ostree/repos.d string value, and to use a similar
feature for repos that are not the system repo.
In particular, this allows us to support /etc/xdg-app/remotes.d for
xdg-app.
Closes: #247
Approved by: cgwalters
Colin Walters [Thu, 14 Apr 2016 15:05:22 +0000 (11:05 -0400)]
man: Elaborate on per-remote GPG
Closes: #258
Approved by: alexlarsson
Alexander Larsson [Mon, 11 Apr 2016 10:43:07 +0000 (12:43 +0200)]
Add OstreeRepo option for an out-of-band cache dir
This allows you to have a writable cache dir even for a system-owned
repository.
Closes: #250
Approved by: cgwalters
Alexander Larsson [Mon, 11 Apr 2016 08:25:40 +0000 (10:25 +0200)]
Add cache_dir_fd to OstreeRepo
This will allow us later to easily swap out the cache dir.
Closes: #250
Approved by: cgwalters
Alexander Larsson [Wed, 13 Apr 2016 19:18:19 +0000 (21:18 +0200)]
commit: Fix crash if dfd_iter is NULL
in write_directory_content_to_mtree_internal dfd_iter can be NULL,
for instance if commiting from --tree=ref=FOO. Don't blindly de-ref
it to avoid crashing.
Closes: #256
Approved by: cgwalters
Alexander Larsson [Wed, 13 Apr 2016 09:14:20 +0000 (11:14 +0200)]
fetcher: Initialize output_stream_set_lock mutex
ostree pull-local crashed for me in thread_closure_unref () doing:
g_mutex_clear (&thread_closure->output_stream_set_lock);
Seems like we never initialize this mutex.
Closes: #254
Approved by: cgwalters
Gatis Paeglis [Tue, 12 Apr 2016 09:26:27 +0000 (11:26 +0200)]
Fix AS_HELP_STRING for builtin grub2 mkconfig
Closes: #253
Approved by: giuseppe
Colin Walters [Fri, 8 Apr 2016 14:28:17 +0000 (10:28 -0400)]
build: Move grub2-15_ostree back to pkglibexecdir
It's not quite namespaced enough to have
`/usr/libexec/grub2-15_ostree`, and the Fedora spec file expects
things in `/usr/libexec/ostree`. Changing the spec file would be
annoying as we'd need conditionals.
Closes: #249
Approved by: gatispaeglis
Colin Walters [Tue, 5 Apr 2016 19:37:32 +0000 (15:37 -0400)]
pull: More consistently use remote_repo_local for local repos
I think it's cleaner if we use `remote_repo_local` to know
that we have a local repo. In reality, it might be nicest
if we didn't even create an `OstreeFetcher` for this case,
but untangling the code is tricky.
Closes: #239
Approved by: alexlarsson
Jonathan Lebon [Mon, 11 Apr 2016 13:27:35 +0000 (09:27 -0400)]
ostree-repo-pull: always initialize flags_i
Otherwise we get undefined behaviour if the client didn't explicitly set
any flags.
Also, add documentation for all the other options supported by
ostree_repo_pull_with_options().
Closes: #252
Approved by: cgwalters
Alexander Larsson [Mon, 11 Apr 2016 10:46:57 +0000 (12:46 +0200)]
Fix the symbol versions for ostree_repo_get_remote_*option
These were accidentally added to 2016.4 instead of 2016.5
Closes: #251
Approved by: cgwalters
Jonathan Lebon [Fri, 8 Apr 2016 16:18:17 +0000 (12:18 -0400)]
small cleanups
- Revert 'cannot' --> 'can not' (it's the exception!)
- Remove duplicate function
- Squelch compiler warnings
Closes: #248
Approved by: cgwalters
Alexander Larsson [Fri, 8 Apr 2016 08:44:24 +0000 (10:44 +0200)]
Add support for ostree static-delta delete
Closes: #245
Approved by: giuseppe
Giuseppe Scrivano [Fri, 8 Apr 2016 10:10:44 +0000 (12:10 +0200)]
cfg.mk: ignore syntax-check for git.mk
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #246
Approved by: cgwalters
Alexander Larsson [Fri, 1 Apr 2016 08:20:34 +0000 (10:20 +0200)]
Add test case for inheriting remote options
Closes: #236
Approved by: cgwalters
Alexander Larsson [Thu, 31 Mar 2016 21:03:53 +0000 (23:03 +0200)]
Inherit remotes and remote options from parent repo
Closes: #236
Approved by: cgwalters
Alexander Larsson [Thu, 31 Mar 2016 20:00:43 +0000 (22:00 +0200)]
Export ostree_repo_get_remote_option* functions
These are useful for ostree users (like xdg-app) that have custom
options for remotes. In particular they are useful when we later make them
all respect self->parent_repo.
Closes: #236
Approved by: cgwalters
Alexander Larsson [Thu, 7 Apr 2016 15:03:08 +0000 (17:03 +0200)]
Support pathnames for --subpath=...
This allows you to pull a single file, rather than just a directory.
Closes: #244
Approved by: cgwalters
Colin Walters [Thu, 31 Mar 2016 19:08:45 +0000 (15:08 -0400)]
Use git.mk
It's a lot nicer than manually maintaining .gitignore in general.
Closes: #235
Approved by: giuseppe
Giuseppe Scrivano [Thu, 7 Apr 2016 08:13:45 +0000 (10:13 +0200)]
docs: Prefer the form "cannot" to "can not"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #242
Approved by: cgwalters
Giuseppe Scrivano [Thu, 7 Apr 2016 08:06:54 +0000 (10:06 +0200)]
Remove empty new lines at the EOF
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #242
Approved by: cgwalters
Giuseppe Scrivano [Thu, 7 Apr 2016 08:11:11 +0000 (10:11 +0200)]
contrib: indent golang code using only tabs instead of both tabs and spaces
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #242
Approved by: cgwalters
Giuseppe Scrivano [Thu, 7 Apr 2016 07:55:54 +0000 (09:55 +0200)]
tests: add missing ${CMD_PREFIX} before ostree
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #242
Approved by: cgwalters
Giuseppe Scrivano [Thu, 7 Apr 2016 07:53:54 +0000 (09:53 +0200)]
tests: add libostreetest.h to EXTRA_DIST
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #242
Approved by: cgwalters
Colin Walters [Thu, 7 Apr 2016 01:26:38 +0000 (21:26 -0400)]
build: Make tests/libreaddir-rand.so rule use AM_V_GEN
So non-verbose builds don't have a verbose rule smack in the middle.
Closes: #241
Approved by: giuseppe
Colin Walters [Wed, 6 Apr 2016 18:22:19 +0000 (14:22 -0400)]
build: Find grub2-mkconfig a bit more automagically
If one happens to not have grub2 installed, the previous commit
would cause us to fall back to `grub-mkconfig` with bad results.
We should likely just do dynamic detection and avoid pain, but
there's no harm in also allowing this to be statically determined.
The automagic here is that if `/etc/os-release` says `ID_LIKE=fedora`,
we know to use `grub2-mkconfig`. But distro scripts should set this
in the build configurations using `--with-grub2-mkconfig=`.
Closes: #240
Approved by: jlebon
Alexander Larsson [Mon, 4 Apr 2016 13:17:17 +0000 (15:17 +0200)]
pull-local: Support --gpg-verify and --gpg-verify-summary
Force the otherwise disabled gpg verifications on.
Note: You need to pass --remote=foo so we know what gpg keys to verify
against.
Closes: #237
Approved by: cgwalters
Alexander Larsson [Mon, 4 Apr 2016 12:43:33 +0000 (14:43 +0200)]
Fix local-pull test
This was not being run for whatever reason. Also, the test
count was wrong.
Closes: #237
Approved by: cgwalters
Alexander Larsson [Mon, 4 Apr 2016 12:26:53 +0000 (14:26 +0200)]
pull: Don't try to cache summaries for pull-local
Not only does this not make sense from a performance perspective, but
it also doesn't work because we can't use a url as a path element.
Closes: #237
Approved by: cgwalters
Gatis Paeglis [Fri, 1 Apr 2016 11:51:18 +0000 (13:51 +0200)]
Introducing ostree-grub-generator
ostree-grub-generator can be used to customize
the generated grub.cfg file. Compile time
decision ostree-grub-generator vs grub2-mkconfig
can be overwritten with the OSTREE_GRUB2_EXEC
envvar - useful for auto tests and OS installers.
Why this alternative approach:
1) The current approach is less flexible than using a
custom 'ostree-grub-generator' script. Each system can
adjust this script for its needs, instead of using the
hardcoded values from ostree-bootloader-grub2.c.
2) Too much overhead on embedded to generate grub.cfg
via /etc/grub.d/ configuration files. It is still
possible to do so, even with this patch applied.
No need to install grub2 package on a target device.
3) The grub2-mkconfig code path has other issues:
https://bugzilla.gnome.org/show_bug.cgi?id=761180
Task: https://bugzilla.gnome.org/show_bug.cgi?id=762220
Closes: #228
Approved by: cgwalters
Krzesimir Nowak [Mon, 4 Apr 2016 13:25:39 +0000 (15:25 +0200)]
manual: Fix a bunch of typos and docbookisms
Closes: #238
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 16:52:57 +0000 (17:52 +0100)]
libtest.sh: only check whether $(pwd) is empty once
test-sysroot.js runs libtestExec() twice, one of which is after
creating non-hidden directories in $(pwd), so this check needs to be
skipped the second time.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 16:47:36 +0000 (17:47 +0100)]
test-xattrs: sync how this is skipped with test-rofiles-fuse
If we touch test-xattrs before sourcing libtest.sh, we get:
test tmpdir=/tmp/test-tmp-ostree_test-xattrs.sh.test-HSEXEY is not
empty; run this test via `make check TESTS=`, not directly
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 17:30:52 +0000 (18:30 +0100)]
test-abi: use G_TEST_SRCDIR, G_TEST_BUILDDIR
There's no need to invent new variables for these.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 17:29:44 +0000 (18:29 +0100)]
libtest.sh: use G_TEST_SRCDIR, G_TEST_BUILDDIR to find resources
This fixes the bug that in installed-tests that run testlib.sh under
"bash -c" (i.e. the C and JS tests), $(dirname $0) is "." and we can't do
the LD_PRELOAD correctly:
ERROR: ld.so: object './libreaddir-rand.so' from LD_PRELOAD cannot be
preloaded (cannot open shared object file): ignored.
Similarly, those tests can't copy gpghome correctly.
This also removes the confusing situation that SRCDIR in libtest.sh
(which is ${top_srcdir}/tests) does not mean the same thing as SRCDIR
in test-abi.sh (which is just ${top_srcdir}).
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #234
Approved by: cgwalters
Colin Walters [Thu, 31 Mar 2016 17:46:16 +0000 (13:46 -0400)]
tests: Make failing to kill the GPG agent non-fatal
It's not working for me in `make check` on a RHEL 7 Workstation,
apparently because no GPG agent is spawned. I'm guessing this has
something to do with the GPG version?
The downside of this is we will be less likely to notice if GPG
changes again and we start leaking agents like we're in The Matrix
Reloaded. But the real solution to that is containers anyways.
Closes: #233
Approved by: smcv
Simon McVittie [Thu, 31 Mar 2016 13:32:55 +0000 (14:32 +0100)]
Probe for GNU parallel more accurately
moreutils parallel isn't compatible with the command-line syntax
used here. Because it doesn't implement GNU-style --help and exits 1
when that option is given, this test was correctly skipped when
using moreutils parallel, but only by mistake.
moreutils parallel might conceivably gain --help and --version in
future, but hopefully nothing incompatible with GNU parallel is going
to gain a --gnu option.
Also use the --gnu option to force the new command-line semantics;
some versions optionally supported an incompatible command-line syntax
taken from moreutils parallel.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Jonathan Lebon [Thu, 31 Mar 2016 13:10:27 +0000 (14:10 +0100)]
basic-test: commit with a non-empty subject
[smcv: split out from a larger commit, part of PR #231; add commit message]
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Jonathan Lebon [Thu, 31 Mar 2016 13:07:01 +0000 (14:07 +0100)]
test-pull-untrusted.sh: always corrupt a regular file, not a symlink
test-pull-untrusted.sh would pass when run as root, but fail when run
as testuser. It turned out that the way the files were stored in the
repo when running as a testuser were different, which meant that a
different .file object was chosen for corruption. Except that file
turned out to be a symlink, so the echo "broke" actually just wrote
to the no_such_file symlink target, thus keeping the actual symlink
file's checksum the same and causing the pull-local to pass when it
should have failed.
[smcv: split this out of a larger commit, part of PR #231]
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 12:44:27 +0000 (13:44 +0100)]
Skip tests that run rofiles-fuse if /dev/fuse or /etc/mtab unavailable
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 09:17:02 +0000 (10:17 +0100)]
Force libreaddir-rand to be a shared library
If installed-tests are disabled, it would normally be a static
(convenience) library, which isn't something we can LD_PRELOAD.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 08:48:18 +0000 (09:48 +0100)]
tests/admin-test.sh: this is a bash script, not a POSIX sh script
The "function foo()" syntax is bash-specific, and Colin indicated in
PR #226 that he prefers to require bash rather than trying to support
every POSIX shell.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 08:02:23 +0000 (09:02 +0100)]
Load g-i bindings from builddir during build-time testing
Previously, the build-time tests would only pass if the g-i bindings to
OSTree were already installed, with a reasonably similar version.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 07:42:09 +0000 (08:42 +0100)]
.gitignore: update
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 07:27:32 +0000 (08:27 +0100)]
In tests that use gpg, terminate the gpg-agent after testing
Otherwise we leak those processes.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 07:24:56 +0000 (08:24 +0100)]
tap-test: clean up temporary test directories as intended
The script created ./.testtmp but looked for ./.test, which isn't
going to work.
This means the various "ostree trivial-httpd --autoexit" processes
actually exit, because their web roots are cleaned up now.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Mon, 28 Mar 2016 12:46:23 +0000 (13:46 +0100)]
Symlink libreaddir-rand.so into tests directory
This means it can be LD_PRELOADed during build-time testing.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Thu, 31 Mar 2016 10:06:05 +0000 (11:06 +0100)]
various tests: skip if temp directory lacks xattr support
Some autobuilder environments place the entire build chroot on tmpfs, so
even /var/tmp might not have this.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Simon McVittie [Mon, 28 Mar 2016 12:08:32 +0000 (13:08 +0100)]
test-xattrs: use TAP syntax to skip test
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #232
Approved by: cgwalters
Colin Walters [Wed, 30 Mar 2016 13:19:38 +0000 (09:19 -0400)]
docs/CONTRIBUTING.md: Update for github move, Homu etc.
Closes: #230
Approved by: jlebon
Jonathan Lebon [Wed, 30 Mar 2016 03:27:19 +0000 (23:27 -0400)]
commit: support editor for orphan commits
This is a follow up to #227 to allow ostree to open the editor also for
orphan commits when no subject or body is given on the cmdline.
Closes: #229
Approved by: cgwalters
Colin Walters [Tue, 29 Mar 2016 14:53:50 +0000 (10:53 -0400)]
commit: Support writing orphans
The API supports this, and it's not hard for us to do in the command
line as well. One possible use case is separating "content
generation" in a separate server.
Related: https://github.com/ostreedev/ostree/pull/223
Closes: #227
Approved by: jlebon
Colin Walters [Fri, 25 Mar 2016 15:03:32 +0000 (11:03 -0400)]
commit: Support generating commits with no parent, or a custom one
When I'm doing local development builds, it's quite common for me not
to want to accumulate history. There are also use cases for this on
build servers as well.
In particular, using this, one could write a build system that didn't
necessarily need to have access to (a copy of) the OSTree repository.
Instead, the build system would determine the last commit ID on the
branch, and pass that to a worker node, then sync the generated
content back.
The API supported generating custom commits that don't necessarily
reference the previous commit on the same branch, let's just expose
this in the command line for convenience.
I plan to also support this rpm-ostree.
Closes: #223
Approved by: jlebon
Colin Walters [Fri, 25 Mar 2016 14:35:25 +0000 (10:35 -0400)]
docs: Add a section on repository management
Just keeping my promise to write more documentation. There could be a
lot more to write here, but I'm trying to get a start done.
Closes: #222
Approved by: jlebon
Simon McVittie [Mon, 28 Mar 2016 11:25:17 +0000 (12:25 +0100)]
packaging: fix bashism in dist-snapshot target
On Debian and its derivatives, /bin/sh is a lightweight POSIX shell
(currently dash) which does not support the bash {foo,bar} syntax.
Signed-off-by: Simon McVittie <smcv@debian.org>
Closes: #226
Approved by: cgwalters
Dan Nicholson [Sat, 26 Mar 2016 15:35:30 +0000 (08:35 -0700)]
main: Set log handler for OSTree domain
Now that OSTree is used as G_LOG_DOMAIN, set the main handler to match
so the appropriate messages are filtered. It would probably be more
appropriate to spell out "OSTree" in the code, but since G_LOG_DOMAIN is
being defined globally in the project, might as well reuse it here.
https://bugzilla.gnome.org/show_bug.cgi?id=764237
Closes: #225
Approved by: cgwalters